<!DOCTYPE html>
<html lang="en">
<head>
    <title>老版本VUE示例</title>
    <style>
        .active{
            border: 1px solid red;
        }
    </style>
</head>

<body>
    <div id="app">
        <a v-bind:href="address">链接</a>
        <button v-on:click="fun">切换</button>
        <hr>
        <div :class="isActive?'active':''">hahahaa</div> 
        <div :class="{active:isActive}">bbbbbbb</div> 
        <!--{active:isActive}意思是:class为“active”的条件是isActive是true  -->
        <button @click="fun2">切换style</button>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app123 = new Vue({
            el:"#app",
            data:{
                address:"http://baidu.com",
                isActive:false
            },
            methods:{
                fun:function(){
                    this.address="https://www.bilibili.com/video/BV1HE411e7vY?p=13"
                },
                fun2:function(){
                    this.isActive=!this.isActive
                }
            }
            
        })
    </script>
</body>
</html>